JBD, or journaling block device, is a generic block device journaling layer in the Linux kernel written by Stephen C. Tweedie from Red Hat.
Contents |
The Journaling Block Device (JBD) provides a filesystem-independent interface for filesystem journaling. ext3, ext4 and OCFS2 are known to use JBD. ext4 uses a fork of JBD called JBD2[1].
An atomic handle as basically a collection of all the low-level changes that occur during a single high-level atomic update to the file system. The atomic handle guarantees that the high-level update either happens or not, because the actual changes to the file system are flushed only after logging the atomic handle in the journal.
For the sake of efficiency and performance, JBD groups several atomic handles into a single transaction, which is written to the journal after a fixed amount of time elapses or there is no free space left on the journal to fit it.
The transaction has several states:
Based on the transaction states, the JBD is able to determine which transactions need to be replayed (or reapplied) to the file system.